package com.lly.songhigh.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.lly.songhigh.fragment.SearchResultFragmentFactory;

import java.util.List;

/**
 * Created by dllo on 15/10/26.
 */
public class SearchResultActivityAdapter extends FragmentPagerAdapter {

    private String[] titles = {"单曲", "歌手", "专辑", "MV"};
    private List<Fragment> fragments;

    public SearchResultActivityAdapter(FragmentManager fm) {
        super(fm);
    }
    @Override
    public int getCount() {
        return titles.length;
    }
    @Override
    public Fragment getItem(int position) {
        return SearchResultFragmentFactory.creatFragment(position);
    }
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}
